//文章详情相关的接口

import request from "@/utils/request";
//根据ip 查看文章详情
export const articleListApi = (article_id) =>
  request({
    url: `/v1_0/articles/${article_id}`,
    method: "get",
  });

// 关注作者 接口 通过token

export const followGoApi = (target) =>
  request({
    url: "/v1_0/user/followings",
    method: "post",
    data: {
      target: target,
    },
  });
// 取关作者 接口 通过token hearder 里面的token 已经被封装好了 这里就不用写了

export const followOutApi = (target) =>
  request({
    url: `/v1_0/user/followings/${target}`,
    method: "delete",
  });

//收藏接口
export const collectedGoApi = (target) =>
  request({
    url: `/v1_0/article/collections`,
    method: "post",
    data: {
      target: target,
    },
  });

//取消收藏文章

export const collectedOutApi = (target) =>
  request({
    url: `/v1_0/article/collections/${target}`,
    method: "delete",
  });

//点赞接口
export const likeingGoApi = (target) =>
  request({
    url: "/v1_0/article/likings",
    method: "post",
    data: {
      target: target,
    },
  });

//取消点赞接口
export const likeingOutApi = (target) =>
  request({
    url: `/v1_0/article/likings/${target}`,
    method: "delete",
  });
